﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.Master" AutoEventWireup="true"
    CodeBehind="file_new.aspx.cs" Inherits="LinkCard.ShopCP.UploadExcel.file_new" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript" src="../Uploadify/Scripts/jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="../Uploadify/Scripts/jquery.uploadify.js"></script>
    <script type="text/javascript">

        $(window).load(function () {
            $("#<%=btnAdd.ClientID %>").click(function () {
                if ($("#<%=txtTest.ClientID %>").val() == "") {
                    alert("Chưa tải file lên server");
                    return false;
                } else if ($("#<%=txtTitle.ClientID %>").val() == "") {
                    alert("Chưa điền tiêu đề file");
                    return false;
                } else {
                    return true;
                }
            });
            $("#<%=FileUpload1.ClientID %>").fileUpload({
                'uploader': '../Uploadify/Scripts/uploader.swf',
                'cancelImg': '../Uploadify/images/cancel.png',
                'buttonText': 'Browse Files',
                'script': 'FileUpload.ashx',
                'folder': 'uploads',
                'fileDesc': 'Adv Files(EXCEL, TXT, DOC)',
                'fileExt': '*.xlsx;*.xls;*.txt;*.doc;*.docx;',
                'sizeLimit': '500000000',
                'multi': true,
                'auto': true,
                'onComplete': function (event, ID, fileObj, response, data) {

                    $("#<%=txtTest.ClientID %>").val(response);
               
                    $("#divUpload").show();
                }
            });
        });

    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <section id="content">
  <section class="container_12 clearfix">
    <section id="main" class="grid_12">
      <article>
        <div class="h1">Thêm mới file</div>
        
          <dl class="inline">
            <dt>
              <label >Tiêu đề:</label>
            </dt>
            <dd>
              <input type="text"   class="big" id="txtTitle" runat="server" />
            </dd>
            <dt>
              <label >File: </label>
            </dt>
            <dd>
             
              <div style="display:none;" id="divUpload"><asp:TextBox runat="server" ID="txtTest" class="big"></asp:TextBox></div>
                            <asp:FileUpload ID="FileUpload1" runat="server" />
            </dd>
            <dt style="display:none">
              <label >Ngày upload:</label>
            </dt>
            <dd style="display:none">
              <input type="text"    id="UploadDate" runat="server" /> (MM/dd/yyyy)
            </dd>
          </dl>
          <p>
          
          <asp:Button class="button big" style="width:auto;" Text="Lưu" ID="btnAdd" runat="server" 
                  onclick="btnAdd_Click" />
          </p>
       
      </article>
    </section>
  </section>
</section>
</asp:Content>
